package com.chuanyang.driverh.mainorder.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.chuanyang.driverh.R;

/**
 * Created by eason on 2016/10/16.
 */
public class RoteMethodAdapter extends BaseAdapter {
    private Context context;
    private String[] methods;

    private ViewHolder holder;

    public RoteMethodAdapter(Context context, String[] methods) {
        this.context=context;
        this.methods=methods;
    }

    @Override
    public int getCount()
    {
        return  methods.length;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if(convertView==null)
        {
            convertView= View.inflate(context, R.layout.order_item_markerpoint,null);
            holder = new ViewHolder();
            holder.tv_marker_point= (TextView) convertView.findViewById(R.id.tv_marker_point);
            convertView.setTag(holder);
        }
        else
        {
            holder= (ViewHolder) convertView.getTag();
        }

            holder.tv_marker_point.setText(methods[position]);



        return convertView;
    }
    class ViewHolder{
        private TextView tv_marker_point;
    }
}
